package com.example.summer_pro.service;

import com.example.summer_pro.entity.Ques;

import java.util.Date;
import java.util.List;

public interface QuesService {
	public Ques getQuesByQid(Integer qid);

	// 仅能获取未被删除的问卷
	public List<Ques> getQuesByUid(Integer uid);

	public List<Ques> getQuesByKeyWord(Integer uid, String keyWord);

	public List<Ques> getDeletedbyUid(Integer uid);

	List<Ques> getDeletedbyKeyWord(Integer uid, String keyWord);
	/**
	 *
	 * @param uid 用户u_id, 用于权限控制，禁止删除不属于自己的问卷
	 * @param qid 需要删除的问卷id
	 * @return 状态码 0: success,
	 * 		1: 问卷不存在,
	 * 		2: 问卷不属于该用户
	 */
	int delQues(Integer uid, Integer qid);

	int createQues(Integer uid, Ques ques);

	int unDeleteQues(Integer uid, Integer qid);

	int setState(Integer uid, Integer qid, Integer state);

	int setValidTime(Integer uid, Integer qid, Date date);

	int copyQues(Integer uid, Integer qid);
}
